<?php

use think\facade\Route;

// Route::redirect('/', 'dist');

// Route::get('admin', function () {
//     return 'hello,Admin!';
// });

Route::get('api/auth/test', 'index/test');

/*登录相关*/
Route::get('api/captchaImage', 'captcha/img');
Route::post('api/auth/login', 'auth/login');
Route::post('api/auth/logout', 'auth/logout');
/*登录相关*/


// 需要登录鉴权的路由
Route::group('api', function () {
    /*登录获取菜单相关*/
    Route::get('auth/getInfo', 'auth/getInfo');
    Route::get('auth/getRouters', 'auth/getRouters');
    /*登录获取菜单相关*/

    /*系统字典类型相关*/
    Route::get('dictType/index', 'admin.SysDictType/index');
    Route::get('dictType/getData', 'admin.SysDictType/getData');
    Route::get('dictType/show', 'admin.SysDictType/show');
    Route::post('dictType/save', 'admin.SysDictType/save');
    Route::post('dictType/update', 'admin.SysDictType/update');
    Route::delete('dictType/del', 'admin.SysDictType/delete');
    Route::get('dictType/optionSelect', 'admin.SysDictType/optionSelect');
    /*系统字典类型相关*/

    /*系统字典数据相关*/
    Route::get('dictData/index', 'admin.SysDictData/index');
    Route::get('dictData/getData', 'admin.SysDictData/getData');
    Route::get('dictData/show', 'admin.SysDictData/show');
    Route::post('dictData/save', 'admin.SysDictData/save');
    Route::post('dictData/update', 'admin.SysDictData/update');
    Route::delete('dictData/del', 'admin.SysDictData/delete');
    /*系统字典数据相关*/

    /*系统部门相关*/
    Route::get('dept/index', 'admin.SysDept/index');
    Route::get('dept/show', 'admin.SysDept/show');
    Route::get('dept/exclude', 'admin.SysDept/exclude');
    Route::post('dept/save', 'admin.SysDept/save');
    Route::post('dept/update', 'admin.SysDept/update');
    Route::delete('dept/del', 'admin.SysDept/delete');
    Route::get('dept/tree', 'admin.SysDept/tree');
    /*系统部门相关*/

    /*系统菜单相关*/
    Route::get('menu/index', 'admin.SysMenu/index');
    Route::get('menu/show', 'admin.SysMenu/show');
    Route::post('menu/save', 'admin.SysMenu/save');
    Route::post('menu/update', 'admin.SysMenu/update');
    Route::delete('menu/del', 'admin.SysMenu/delete');
    Route::get('menu/treeselect', 'admin.SysMenu/treeSelect');
    Route::get('menu/roleMenuTreeselect', 'admin.SysMenu/roleMenuTreeselect');
    /*系统菜单相关*/

    /*系统角色相关*/
    Route::get('role/index', 'admin.SysRole/index');
    Route::get('role/show', 'admin.SysRole/show');
    Route::post('role/save', 'admin.SysRole/save');
    Route::post('role/update', 'admin.SysRole/update');
    Route::post('role/dataScope', 'admin.SysRole/dataScope');
    Route::delete('role/del', 'admin.SysRole/delete');
    Route::get('role/deptTree', 'admin.SysRole/deptTree');
    Route::post('role/changeStatus', 'admin.SysRole/changeStatus');

    Route::get('role/allocatedList', 'admin.SysRole/allocatedList');
    Route::get('role/unallocatedList', 'admin.SysRole/unallocatedList');
    Route::post('role/authUserCancel', 'admin.SysRole/authUserCancel');
    Route::post('role/authUserCancelAll', 'admin.SysRole/authUserCancelAll');
    Route::post('role/authUserSelectAll', 'admin.SysRole/authUserSelectAll');

    /*系统角色相关*/

    /*系统用户相关*/
    Route::get('sysUser/index', 'admin.SysUser/index');
    Route::get('sysUser/show', 'admin.SysUser/show');
    Route::post('sysUser/save', 'admin.SysUser/save');
    Route::post('sysUser/update', 'admin.SysUser/update');
    Route::post('sysUser/resetPwd', 'admin.SysUser/resetPwd');
    Route::delete('sysUser/del', 'admin.sysUser/delete');
    Route::post('sysUser/changeStatus', 'admin.SysUser/changeStatus');
    Route::get('sysUser/allocatedList', 'admin.sysUser/allocatedList');

    Route::get('sysUser/profile', 'admin.sysUser/profile');
    Route::post('sysUser/updateProfile', 'admin.sysUser/updateProfile');
    Route::post('sysUser/updatePwd', 'admin.sysUser/updatePwd');

    /*系统用户相关*/

    /*系统操作日志相关*/
    Route::get('sysOperLog/index', 'admin.sysOperLog/index');
    Route::get('sysOperLog/userOperLog', 'admin.sysOperLog/userOperLog');
    Route::delete('sysOperLog/del', 'admin.sysOperLog/delete');
    Route::delete('sysOperLog/clean', 'admin.sysOperLog/clean');
    /*系统操作日志相关*/
    /*系统登录日志相关*/
    Route::get('sysLoginLog/index', 'admin.sysLoginLog/index');
    Route::delete('sysLoginLog/del', 'admin.sysLoginLog/delete');
    Route::delete('sysLoginLog/clean', 'admin.sysLoginLog/clean');
    /*系统登录日志相关*/

    /*系统会员相关*/
    Route::get('sysMember/index', 'admin.sysMember/index');
    Route::get('sysMember/show', 'admin.sysMember/show');
    Route::post('sysMember/save', 'admin.sysMember/save');
    Route::post('sysMember/update', 'admin.sysMember/update');
    Route::post('sysMember/resetPwd', 'admin.sysMember/resetPwd');
    Route::delete('sysMember/del', 'admin.sysMember/delete');
    Route::post('sysMember/changeStatus', 'admin.sysMember/changeStatus');
    Route::get('sysMember/profile', 'admin.sysMember/profile');
    Route::post('sysMember/updateProfile', 'admin.sysMember/updateProfile');
    Route::post('sysMember/updatePwd', 'admin.sysMember/updatePwd');
    /*系统会员相关*/

    /*系统会员分组相关*/
    Route::get('SysMemberGroup/index', 'admin.SysMemberGroup/index');
    Route::get('SysMemberGroup/show', 'admin.SysMemberGroup/show');
    Route::post('SysMemberGroup/save', 'admin.SysMemberGroup/save');
    Route::post('SysMemberGroup/update', 'admin.SysMemberGroup/update');
    Route::delete('SysMemberGroup/del', 'admin.SysMemberGroup/delete');
    /*系统会员分组相关*/

    /*系统菜单相关*/
    Route::get('SysMemberMenu/index', 'admin.SysMemberMenu/index');
    Route::get('SysMemberMenu/show', 'admin.SysMemberMenu/show');
    Route::post('SysMemberMenu/save', 'admin.SysMemberMenu/save');
    Route::post('SysMemberMenu/update', 'admin.SysMemberMenu/update');
    Route::delete('SysMemberMenu/del', 'admin.SysMemberMenu/delete');
    Route::get('SysMemberMenu/treeselect', 'admin.SysMemberMenu/treeSelect');
    Route::get('SysMemberMenu/userMenuTreeselect', 'admin.SysMemberMenu/userMenuTreeselect');
    /*系统菜单相关*/


    // 商品分类
    Route::get('productCate/index', 'admin.CateController/index');
    Route::get('productCate/getAll', 'admin.CateController/getAll');
    Route::post('productCate/create', 'admin.CateController/create');
    Route::post('productCate/changeStatus/:id', 'admin.CateController/changeStatus');
    Route::post('productCate/update/:id', 'admin.CateController/update');
    Route::post('productCate/delete/:id', 'admin.CateController/delete');


    Route::get('shippingTemp/index', 'admin.ShippingTempController/index');
    Route::get('shippingTemp/getAll', 'admin.ShippingTempController/getAll');
    Route::get('shippingTemp/detail/:id', 'admin.ShippingTempController/detail');
    Route::post('shippingTemp/create', 'admin.ShippingTempController/create');
    Route::post('shippingTemp/update/:id', 'admin.ShippingTempController/update');
    Route::post('shippingTemp/del/:id', 'admin.ShippingTempController/del');



    Route::get('productAttrTemp/index', 'admin.ProductAttrTempController/index');
    Route::get('productAttrTemp/getAll', 'admin.ProductAttrTempController/getAll');
    Route::post('productAttrTemp/create', 'admin.ProductAttrTempController/create');
    Route::post('productAttrTemp/update/:id', 'admin.ProductAttrTempController/update');
    Route::post('productAttrTemp/del/:id', 'admin.ProductAttrTempController/del');

    // 商品
    Route::get('product/index', 'admin.ProductController/index');
    Route::get('product/detail/:id', 'admin.ProductController/detail');
    // 修改或编辑
    Route::post('product/save', 'admin.ProductController/save');
    Route::post('product/delete/:id', 'admin.ProductController/delete');
    Route::post('product/changeStatus/:id', 'admin.ProductController/changeStatus');


    // 运营商
    Route::get('opUser/index', 'admin.OpUserController/index');
    Route::get('opUser/getAll', 'admin.OpUserController/getAll');
    Route::post('opUser/create', 'admin.OpUserController/create');
    Route::post('opUser/changeStatus/:id', 'admin.OpUserController/changeStatus');
    Route::post('opUser/update/:id', 'admin.OpUserController/update');
    Route::post('opUser/delete/:id', 'admin.OpUserController/delete');

    // 利润设置
    Route::get('profitSet/getInfo', 'admin.ProfitSetController/getInfo');
    Route::post('profitSet/setInfo', 'admin.ProfitSetController/setInfo');
    // 协议政策
    Route::get('pact/getInfo', 'admin.PactController/getInfo');
    Route::post('pact/setInfo', 'admin.PactController/setInfo');



    // 海报
    Route::get('poster/getList', 'admin.PosterController/getList');
    Route::get('poster/detail/:id', 'admin.PosterController/detail');
    Route::post('poster/del/:id', 'admin.PosterController/del');
    Route::post('poster/add', 'admin.PosterController/add');
    Route::post('poster/edit/:id', 'admin.PosterController/edit');

    // 订单
    Route::get('order/getList', 'admin.OrderController/getList');
    Route::post('order/sendGoods', 'admin.OrderController/sendGoods');

    Route::post('order/changeExpressNo', 'admin.OrderController/changeExpressNo');

    Route::get('order/getOrderLog', 'admin.OrderController/getOrderLog');
    Route::get('order/orderCensus', 'admin.OrderController/orderCensus');

    Route::get('refund/refundList', 'admin.RefundController/refundList');
    Route::post('refund/refundOrder', 'admin.RefundController/refundOrder');
    Route::post('refund/confirmRefund', 'admin.RefundController/confirmRefund');
    Route::post('refund/onlyRefundMoney', 'admin.RefundController/onlyRefundMoney');
    Route::post('refund/onlyRefund', 'admin.RefundController/onlyRefund');



    // 提现金额配置
    Route::get('applySet/getList', 'admin.ApplyMoneySetController/getList');
    Route::post('applySet/change', 'admin.ApplyMoneySetController/change');
    Route::post('applySet/add', 'admin.ApplyMoneySetController/add');
    Route::post('applySet/del', 'admin.ApplyMoneySetController/del');

    // 提现支付配置
    Route::get('applyPay/getInfo', 'admin.ApplyPayController/getInfo');
    Route::post('applyPay/change', 'admin.ApplyPayController/change');

    // 轮播图
    Route::get('banner/getList', 'admin.BannerController/getList');
    Route::post('banner/add', 'admin.BannerController/add');
    Route::post('banner/change', 'admin.BannerController/change');
    Route::post('banner/del', 'admin.BannerController/del');

    // 用户列表
    Route::get('mini/getUserList', 'admin.MiniUserController/getUserList');

    // 资金记录
    Route::get('balance/getBalanceLog', 'admin.BalanceLogController/getBalanceLog');

    // 提现管理
    Route::get('miniApply/getList', 'admin.MiniApplyController/getList');
    Route::post('miniApply/changeStatus', 'admin.MiniApplyController/changeStatus');
    Route::post('miniApply/changeMore', 'admin.MiniApplyController/changeMore');
    Route::get('miniApply/getApplyDetail', 'admin.MiniApplyController/getApplyDetail');
    // 上传支付文件
    Route::post('payment/uploadPayfile', 'CommonController/uploadPayfile');
    // 上传图片
    Route::post('common/uploadFile', 'CommonController/uploadFile');
    // 富文本上传图片
    Route::post('common/uploadFileByEdit', 'CommonController/uploadFileByEdit');
    Route::get('common/getProvinceList', 'CommonController/getProvinceList');
    Route::get('common/getCityList', 'CommonController/getCityList');
    /*系统登录日志相关*/
})->middleware([\app\middleware\AuthCheck::class, \app\middleware\PermissionCheck::class, \app\middleware\OperLog::class]);
// \app\middleware\RequestLimit::class
